package com.scau.hwadee.examination.controller;

import com.scau.hwadee.examination.service.ProfessionalPlanService;
import com.scau.hwadee.examination.vo.ResponseVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author: YHX
 * @date: 2019/7/28 19:28
 * @description: 专业计划模块
 */
@Slf4j
@Controller
@RequestMapping("/professional/plan")
@Api(tags = "ProfessionalPlanController",description ="专业计划模块")
public class ProfessionalPlanController {

    @Autowired
    private ProfessionalPlanService professionPlanService;

    @GetMapping("majorVersions")
    @ApiOperation(value ="获取所有的计划版本信息")
    public ResponseEntity<ResponseVo> getAllMajorVersions(@RequestParam("pageNum") int pageNum,
                                                          @RequestParam("pageSize") int pageSize){
        log.debug("获取所有的计划版本信息");
        ResponseVo vo=ResponseVo.instance();
        vo.setData(professionPlanService.getAllMajorPlanVersion(pageNum,pageSize));
        return new ResponseEntity<>(vo, HttpStatus.OK);
    }


}
